<template>
  <div class="content flex ac jb">
    <div class="left-box" v-loading="pageLoading">
      <div class="left-item">
        <div class="title-box">操作区域</div>
        <div class="btn-box flex ac jb">
          <div class="btn-left">
            <el-button v-if="
              detailData.status == '1000' && userInfoData.position_id == 1
            " type="primary" @click="fpkhjlVisible = true">分配客户经理</el-button><!-- 客户总监 -->
            <el-button type="primary" v-if="
              detailData.status == '1015' && userInfoData.position_id == 2
            " @click="scsjtVisible = true">上传设计图</el-button><!-- 客户经理   --需勘场 -->

            <!-- ------------------需要勘场------------------- -->
            <el-button type="primary" v-if="
              detailData.status == '1020' && userInfoData.position_id == 2
            " @click="kcxxVisible = true">提交勘场凭证</el-button><!-- 客户经理   需要勘场 -->
            <el-button v-if="
              detailData.status == '1025' && userInfoData.position_id == 9
            " type="primary" @click="kcfdkqrVisible = true">勘场费打款确认</el-button><!-- 财务   需要勘场 -->
            <el-button type="primary" v-if="
              detailData.status == '1030' && userInfoData.position_id == 6
            " @click="fpgcjVisible = true">分配勘场工程经理</el-button><!-- 工程部经理   需要勘场 -->
            <el-button type="primary" v-if="
              detailData.status == '1045' && userInfoData.position_id == 7
            " @click="tjkcxxVisible = true">提交勘场报告</el-button><!-- 工程经理   需要勘场 -->
            <el-button type="primary" v-if="
              detailData.status == '1055' && userInfoData.position_id == 3
            " @click="shkczlVisible = true">上传勘场资料</el-button><!-- 设计师   需要勘场 -->
            <el-button v-if="
              detailData.status == '1060' && userInfoData.position_id == 2
            " type="primary" @click="scsjtVisible = true">上传设计图</el-button><!-- 客户经理   需要勘场 -->
            <!-- ------------------需要勘场------------------- -->
            <!-- ------------------结束------------------- -->

            <el-button type="primary" v-if="
              detailData.status == '1065' && userInfoData.position_id == 2
            " @click="sqbjVisible = true">申请报价</el-button><!-- 客户经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1070' &&
              userInfoData.position_id == 4 &&
              !detailData.cost_estimator_id
            " @click="fpzjyVisible = true">分配造价员</el-button><!-- 造价主管 -->
            <el-button type="primary" v-if="
              (detailData.status == '1070' ||
                detailData.status == '1080' ||
                detailData.status == '1090') &&
              userInfoData.position_id == 6 &&
              !detailData.engineering_manager_id
            " @click="fpgcjVisible = true">分配施工工程经理</el-button><!-- 工程部经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1080' && userInfoData.position_id == 5
            " @click="cjzjdVisible = true">出具造价单</el-button><!-- 造价员 -->
            <el-button v-if="
              detailData.status == '1090' &&
              userInfoData.position_id == 7 &&
              detailData.engineering_manager_id &&
              detailData.engineering_manager_id == userInfoData.userid
            " type="primary" @click="shbjdVisible = true">审核造价单</el-button><!-- 工程经理(施工工程经理) -->
            <el-button type="primary" v-if="
              detailData.status == '1092' && userInfoData.position_id == 4
            " @click="shbjdVisible = true">审核造价单</el-button><!-- 造价主管 -->

            <el-button v-if="
              detailData.status == '1095' && userInfoData.position_id == 2
            " type="primary" @click="dkbjVisible = true">对客报价</el-button><!-- 客户经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1095' && userInfoData.position_id == 2
            " @click="xmhtFunc('bj')">回退至项目报价单</el-button><!-- 客户经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1100' && userInfoData.position_id == 1
            " @click="shdkbjdVisible = true">审核对客报价单</el-button><!-- 客户总监 -->
            <el-button type="primary" v-if="
              detailData.status == '1102' && userInfoData.position_id == 2
            " @click="tjqdhtVisible = true">提交签订合约</el-button><!-- 客户经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1105' && userInfoData.position_id == 2
            " @click="tjyfkpzVisible = true">提交预付款凭证</el-button><!-- 客户经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1110' && userInfoData.position_id == 9
            " @click="yfkdkqrVisible = true">预付款打款确认</el-button><!-- 财务 -->

            <el-button type="primary" v-if="
              detailData.status == '1115' && userInfoData.position_id == 8
            " @click="qrkssgVisible = true">确认开始施工</el-button><!-- 工程监理 -->

            <!-- -----------------------------------节点验收过程（开始）------------------------------------ -->
            <el-button type="primary" v-if="
              (detailData.status == '1118' || detailData.status == '1120') &&
              userInfoData.position_id == 7 &&
              projectNodesItem.node_status == 1 &&
              detailData.engineering_manager_id == userInfoData.userid
            " @click="jdysShouwFunc">节点验收</el-button><!-- 工程经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1120' &&
              userInfoData.position_id == 8 &&
              projectNodesItem.node_status == 2
            " @click="jdysshVisible = true">节点验收审核</el-button><!-- 工程监理 -->
            <el-button type="primary" v-if="
              detailData.status == '1120' &&
              userInfoData.position_id == 6 &&
              projectNodesItem.node_status == 3
            " @click="jdysshVisible = true">节点验收审核</el-button><!-- 工程部经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1120' &&
              userInfoData.position_id == 2 &&
              projectNodesItem.node_status == 4
            " @click="tjjdkpzVisible = true">提交进度款凭证</el-button><!-- 客户经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1120' &&
              userInfoData.position_id == 9 &&
              projectNodesItem.node_status == 5
            " @click="jdkqrVisible = true">进度款打款确认</el-button><!-- 财务 -->
            <!-- -----------------------------------节点验收过程(结束)------------------------------------ -->

            <el-button type="primary" v-if="
              (detailData.status == '1120' || detailData.status == '1118') &&
              userInfoData.position_id == 8
            " @click="sgjlVisible = true">施工记录</el-button><!-- 工程监理 -->
            <el-button type="primary" v-if="
              detailData.status == '1125' && userInfoData.position_id == 2
            " @click="qrzjxVisible = true">确认增减项</el-button><!-- 客户经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1130' && userInfoData.position_id == 5
            " @click="cjjsdVisible = true">出具结算单</el-button><!-- 造价员 -->
            <el-button type="primary" v-if="
              detailData.status == '1135' &&
              userInfoData.position_id == 7 &&
              detailData.engineering_manager_id == userInfoData.userid
            " @click="shjsdVisible = true">审核结算单</el-button><!-- 工程经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1138' && userInfoData.position_id == 4
            " @click="shjsdVisible = true">审核结算单</el-button><!-- 造价主管 -->
            <el-button type="primary" v-if="
              detailData.status == '1140' && userInfoData.position_id == 2
            " @click="tjwkpzVisible = true">提交尾款信息</el-button><!-- 客户经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1140' && userInfoData.position_id == 2
            " @click="xmhtFunc('js')">回退至项目结算单</el-button><!-- 客户经理 -->
            <el-button type="primary" v-if="
              detailData.status == '1145' && userInfoData.position_id == 1
            " @click="shwkxxVisible = true">审核尾款信息</el-button><!-- 客户总监 -->
            <el-button type="primary" v-if="
              detailData.status == '1147' && userInfoData.position_id == 9
            " @click="qrwkxxVisible = true">确认尾款信息</el-button><!-- 财务 -->
            <!-- <el-button type="primary" v-if="detailData.status == '1150'"
              >客户评价</el-button
            >
            <el-button type="primary" v-if="detailData.status == '1155'"
              >客户已评价</el-button
            >
            <el-button type="primary" v-if="detailData.status == '1160'"
              >客户发起售后</el-button
            >
            <el-button type="primary" v-if="detailData.status == '1165'"
              >维保结束</el-button
            > -->
            <!--  == 10 -->
            <el-button v-if="
              userInfoData.position_id == 10 &&
              detailData.survey_site != 0 &&
              detailData.status < 1150
            " @click="adminBackFunc">回退项目进度</el-button><!-- 管理员 -->
            <!-- 尾款结束之前 客户经理一直存在的操作 -->
            <template v-if="
              detailData.status != 1500 &&
              detailData.status < 1150 &&
              detailData.status
            ">
              <el-button type="primary" v-if="
                userInfoData.position_id == 2 && detailData.status != '1145'
              " @click="dkrzVisible = true">对客日志</el-button>
              <el-button v-if="
                userInfoData.position_id == 2 && detailData.status != '1145'
              " type="primary" @click="editProjectFunc">项目完善</el-button>
              <el-button v-if="
                userInfoData.position_id == 2 && detailData.status != '1145'
              " @click="xmqxVisible = true">项目取消</el-button>
            </template>
            <el-button v-if="
              detailData.status < 1092 &&
              userInfoData.position_id == 7 &&
              detailData.engineering_manager_id &&
              detailData.engineering_manager_id == userInfoData.userid
            " @click="gcjljjjdVisible = true">拒绝接单</el-button><!-- 工程经理 -->
          </div>
          <div class="btn-right">
            <el-button @click="projectHisFunc">项目历史记录</el-button>
          </div>
        </div>
      </div>
      <div class="left-item flex ac" v-loading="tabLoading">
        <template v-for="(item, index) in tabList">
          <span v-if="!item.hide" @click="tabClickFunc(item.value, item.disabled)" :class="[
            tabActive == item.value
              ? 'tab-item-active tab-item transition3'
              : 'tab-item transition3',
            item.disabled ? 'disabled' : '',
          ]" :key="index">{{ item.label }}</span>
        </template>
      </div>
      <el-empty description="无数据" v-if="tabActive != 0 && !tabData"></el-empty>
      <transition name="fade">
        <div class="left-item" v-if="tabActive == 0 && jcxxImteShow">
          <div class="title-box" v-if="jcxxImteShow">基础信息</div>
          <el-descriptions title="" direction="horizontal" :column="3" border>
            <el-descriptions-item label="项目名称" v-if="fieldShowFunc('project_name')">
              {{ detailData.project_name || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="项目编号" v-if="fieldShowFunc('project_number')">
              {{ detailData.project_number || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="项目品牌" v-if="fieldShowFunc('brand_name')">
              {{ detailData.brand_name || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="项目类型" v-if="fieldShowFunc('project_type')">
              <template v-if="detailData.project_type == 1">新店</template>
              <template v-if="detailData.project_type == 2">改造店</template>
              <template v-if="detailData.project_type == 3">翻新店</template>
              <template v-if="detailData.project_type == 4">特批新店</template>
              <template v-if="detailData.project_type == 5">特批改造店</template>
              <template v-if="detailData.project_type == 6">现场对接店</template>
            </el-descriptions-item>
            <el-descriptions-item label="是否勘场" v-if="fieldShowFunc('survey_site')">
              <template v-if="detailData.survey_site == 1">无需勘场</template>
              <template v-if="detailData.survey_site == 2">勘场出图</template>
            </el-descriptions-item>
            <el-descriptions-item label="项目进度" v-if="fieldShowFunc('display_status')">
              <template v-if="detailData.display_status == 10">待启动</template>
              <template v-if="detailData.display_status == 15">待勘场</template>
              <template v-if="detailData.display_status == 18">待勘场出图</template>
              <template v-if="detailData.display_status == 20">出图中</template>
              <template v-if="detailData.display_status == 25">待报价</template>
              <template v-if="detailData.display_status == 30">洽谈中</template>
              <template v-if="
                (detailData.display_status == 40 ||
                  detailData.display_status > 40) &&
                detailData.display_status != 70
              ">已签约</template>
              <template v-if="detailData.display_status == 42">-待进场</template>
              <template v-if="detailData.display_status == 45">-施工中</template>
              <template v-if="detailData.display_status == 50">-已完工</template>
              <template v-if="detailData.display_status == 55">-待结算</template>
              <template v-if="detailData.display_status == 60">-款项付清</template>
              <template v-if="detailData.display_status == 70">项目取消</template>
            </el-descriptions-item>
            <el-descriptions-item label="省市区" v-if="fieldShowFunc('display_status')">
              {{ detailData.area || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="详细地址" v-if="fieldShowFunc('address')">
              {{ detailData.address || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="品牌经理" v-if="fieldShowFunc('channel_manager_name')">
              {{ detailData.channel_manager_name || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="客户经理" v-if="fieldShowFunc('account_manager_name')">
              {{ detailData.account_manager_name || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="创建时间" v-if="fieldShowFunc('created_at')">
              {{ detailData.created_at || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="最新沟通进度" v-if="fieldShowFunc('latest_communication_progress')">
              {{ detailData.latest_communication_progress || "--" }}
            </el-descriptions-item>
          </el-descriptions>
        </div>
      </transition>

      <transition name="fade">
        <div class="left-item" v-if="tabActive == 1">
          <div class="title-box" v-if="khxxItemShow">客户信息</div>
          <el-descriptions v-if="khxxItemShow" title="" direction="horizontal" :column="3" border>
            <el-descriptions-item label="会员编号" v-if="fieldShowFunc('KH_member_id')">
              {{ tabData.KH_member_id || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="客户名称" v-if="fieldShowFunc('KH_name')">
              {{ tabData.KH_name || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="联系方式" v-if="fieldShowFunc('KH_phone')">
              {{ tabData.KH_phone || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="年龄" v-if="fieldShowFunc('KH_customer_age')">
              {{ tabData.KH_customer_age || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="性别" v-if="fieldShowFunc('KH_customer_sex')">
              <span v-if="tabData.KH_customer_sex == 0">未知</span>
              <span v-if="tabData.KH_customer_sex == 1">男</span>
              <span v-if="tabData.KH_customer_sex == 2">女</span>
            </el-descriptions-item>
            <el-descriptions-item label="客户身份" v-if="fieldShowFunc('KH_customer_identity')">
              <span v-if="tabData.KH_customer_identity == 1">老板</span>
              <span v-if="tabData.KH_customer_identity == 2">合伙人</span>
              <span v-if="tabData.KH_customer_identity == 3">项目负责人</span>
              <span v-if="tabData.KH_customer_identity == 0">--</span>
            </el-descriptions-item>
            <el-descriptions-item label="客户类型" v-if="fieldShowFunc('KH_customer_type')">
              <span v-if="tabData.KH_customer_type == 1">VIP客户</span>
              <span v-if="tabData.KH_customer_type == 2">优质客户</span>
              <span v-if="tabData.KH_customer_type == 3">普通老客户</span>
              <span v-if="tabData.KH_customer_type == 4">优质新客户</span>
              <span v-if="tabData.KH_customer_type == 5">普通新客户</span>
              <span v-if="tabData.KH_customer_type == 0">--</span>
            </el-descriptions-item>
            <el-descriptions-item label="客户业务区域" v-if="fieldShowFunc('KH_customer_type')">
              {{ tabData.KH_business_area || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="对客关注度" v-if="fieldShowFunc('KH_customer_attention')">
              <span v-if="tabData.KH_customer_attention == 1">持续重点关注</span>
              <span v-if="tabData.KH_customer_attention == 2">持续关注</span>
              <span v-if="tabData.KH_customer_attention == 3">定期关注</span>
              <span v-if="tabData.KH_customer_attention == 4">不定期关注</span>
              <span v-if="tabData.KH_customer_attention == 5">一般关注</span>
              <span v-if="tabData.KH_customer_attention == 0">--</span>
            </el-descriptions-item>
            <el-descriptions-item label="目前经营品牌" v-if="fieldShowFunc('KH_current_operating_brand')">
              {{ tabData.KH_current_operating_brand || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="次社会关系" v-if="fieldShowFunc('KH_secondary_social_relations')">
              <span v-if="tabData.KH_secondary_social_relations == 1">品牌方关系户</span>
              <span v-if="tabData.KH_secondary_social_relations == 2">我司关系户</span>
              <span v-if="tabData.KH_secondary_social_relations == 3">政府关系户</span>
              <span v-if="tabData.KH_secondary_social_relations == 4">一般关系</span>
              <span v-if="tabData.KH_secondary_social_relations == 0">--</span>
            </el-descriptions-item>
            <el-descriptions-item label="客户态度" v-if="fieldShowFunc('KH_customer_attitude')">
              <span v-if="tabData.KH_customer_attitude == 1">积极主动</span>
              <span v-if="tabData.KH_customer_attitude == 2">沟通顺畅</span>
              <span v-if="tabData.KH_customer_attitude == 3">敷衍了事</span>
              <span v-if="tabData.KH_customer_attitude == 4">拒不配合</span>
              <span v-if="tabData.KH_customer_attitude == 0">--</span>
            </el-descriptions-item>
            <el-descriptions-item label="年度开店计划" v-if="fieldShowFunc('KH_annual_store_opening_plan')">
              <span v-if="tabData.KH_annual_store_opening_plan == 1">不连续且少量开店</span>
              <span v-if="tabData.KH_annual_store_opening_plan == 2">不连续且大量开店</span>
              <span v-if="tabData.KH_annual_store_opening_plan == 3">持续且少量开店</span>
              <span v-if="tabData.KH_annual_store_opening_plan == 4">持续且大量开店</span>
              <span v-if="tabData.KH_annual_store_opening_plan == 0">--</span>
            </el-descriptions-item>
            <el-descriptions-item label="投资能力" v-if="fieldShowFunc('KH_investment_capability')">
              <span v-if="tabData.KH_investment_capability == 1">100w以下</span>
              <span v-if="tabData.KH_investment_capability == 2">100-500w</span>
              <span v-if="tabData.KH_investment_capability == 3">500-1000w</span>
              <span v-if="tabData.KH_investment_capability == 4">1000w以上</span>
              <span v-if="tabData.KH_investment_capability == 0">--</span>
            </el-descriptions-item>
            <el-descriptions-item label="备注" v-if="fieldShowFunc('KH_remark')">
              {{ tabData.KH_remark || "--" }}
            </el-descriptions-item>
          </el-descriptions>
          <div class="title2" v-if="tabData.KH_partner_list.length && khlxrItemShow">
            联系人
          </div>
          <template v-for="(item, index) in tabData.KH_partner_list">
            <el-descriptions v-if="khlxrItemShow" style="margin-bottom: 10px" title="" direction="horizontal"
              :column="3" border :key="index">
              <el-descriptions-item label="联系人名称" v-if="fieldShowFunc('customer_name')">
                {{ item.customer_name || "--" }}
              </el-descriptions-item>
              <el-descriptions-item label="联系方式" v-if="fieldShowFunc('customer_phone')">
                {{ item.customer_phone || "--" }}
              </el-descriptions-item>
              <el-descriptions-item label="客户身份" v-if="fieldShowFunc('customer_identity')">
                <span v-if="item.customer_identity == 1">老板</span>
                <span v-if="item.customer_identity == 2">合伙人</span>
                <span v-if="item.customer_identity == 3">项目负责人</span>
                <span v-if="item.customer_identity == 0">--</span>
              </el-descriptions-item>
              <el-descriptions-item label="对客关注度" v-if="fieldShowFunc('customer_attention')">
                <span v-if="item.customer_attention == 1">持续重点关注</span>
                <span v-if="item.customer_attention == 2">持续关注</span>
                <span v-if="item.customer_attention == 3">定期关注</span>
                <span v-if="item.customer_attention == 4">不定期关注</span>
                <span v-if="item.customer_attention == 5">一般关注</span>
                <span v-if="item.customer_attention == 0">--</span>
              </el-descriptions-item>
              <el-descriptions-item label="客户态度" v-if="fieldShowFunc('customer_attitude')">
                <span v-if="item.customer_attitude == 1">积极主动</span>
                <span v-if="item.customer_attitude == 2">沟通顺畅</span>
                <span v-if="item.customer_attitude == 3">敷衍了事</span>
                <span v-if="item.customer_attitude == 4">拒不配合</span>
                <span v-if="item.customer_attitude == 0">--</span>
              </el-descriptions-item>
              <el-descriptions-item label="年度开店计划" v-if="fieldShowFunc('annual_store_opening_plan')">
                <span v-if="item.annual_store_opening_plan == 1">不连续且少量开店</span>
                <span v-if="item.annual_store_opening_plan == 2">不连续且大量开店</span>
                <span v-if="item.annual_store_opening_plan == 3">持续且少量开店</span>
                <span v-if="item.annual_store_opening_plan == 4">持续且大量开店</span>
                <span v-if="item.annual_store_opening_plan == 0">--</span>
              </el-descriptions-item>
              <el-descriptions-item label="目前经营品牌" v-if="fieldShowFunc('current_operating_brand')">
                {{ item.current_operating_brand || "--" }}
              </el-descriptions-item>
              <el-descriptions-item label="次社会关系" v-if="fieldShowFunc('secondary_social_relations')">
                <span v-if="item.secondary_social_relations == 1">品牌方关系户</span>
                <span v-if="item.secondary_social_relations == 2">我司关系户</span>
                <span v-if="item.secondary_social_relations == 3">政府关系户</span>
                <span v-if="item.secondary_social_relations == 4">一般关系</span>
                <span v-if="item.secondary_social_relations == 0">--</span>
              </el-descriptions-item>
              <el-descriptions-item label="投资能力" v-if="fieldShowFunc('investment_capability')">
                <span v-if="item.investment_capability == 1">100w以下</span>
                <span v-if="item.investment_capability == 2">100-500w</span>
                <span v-if="item.investment_capability == 3">500-1000w</span>
                <span v-if="item.investment_capability == 4">1000w以上</span>
                <span v-if="item.investment_capability == 0">--</span>
              </el-descriptions-item>
              <el-descriptions-item label="备注" v-if="fieldShowFunc('customer_remark')">
                {{ item.remark || "--" }}
              </el-descriptions-item>
            </el-descriptions>
          </template>
        </div>
      </transition>

      <transition name="fade">
        <div class="left-item" v-if="tabActive == 2 && tabData">
          <div class="title-box" v-if="kcxxItemShow">勘场信息</div>
          <el-descriptions v-if="kcxxItemShow" title="" direction="horizontal" :column="3" border>
            <el-descriptions-item label="设计师" v-if="fieldShowFunc('designer_name')">
              {{ tabData.designer_name || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="勘场工程经理" v-if="fieldShowFunc('site_surveyors_name')">
              {{ detailData.site_surveyors_name || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="申请勘场日期" v-if="fieldShowFunc('apply_survey_date')">
              {{ tabData.apply_survey_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="约定勘场日期" v-if="fieldShowFunc('survey_date')">
              {{ tabData.survey_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="实际勘场日期" v-if="fieldShowFunc('actual_survey_date')">
              {{ tabData.actual_survey_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="现场图片" v-if="fieldShowFunc('scene_file')">
              <template v-if="tabData.scene_file.length">
                <div class="file-name" v-for="(item, index) in tabData.scene_file" :key="index"
                  @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="现场视频" v-if="fieldShowFunc('video_file')">
              <template v-if="tabData.video_file.length">
                <div class="file-name" v-for="(item, index) in tabData.video_file" :key="index"
                  @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="勘场报告" v-if="fieldShowFunc('report_file')">
              <template v-if="tabData.report_file.length">
                <div class="file-name" v-for="(item, index) in tabData.report_file" :key="index"
                  @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="手绘图" v-if="fieldShowFunc('sketch_file')">
              <template v-if="tabData.sketch_file.length">
                <div class="file-name" v-for="(item, index) in tabData.sketch_file" :key="index"
                  @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="勘场资料" v-if="fieldShowFunc('survey_data')">
              <template v-if="tabData.survey_data.length">
                <div class="file-name" v-for="(item, index) in tabData.survey_data" :key="index"
                  @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
          </el-descriptions>
          <div class="title2" v-if="xmsjtItemShow">项目设计图</div>
          <el-descriptions v-if="xmsjtItemShow" title="" direction="horizontal" :column="3" border>
            <el-descriptions-item label="平面图" v-if="fieldShowFunc('plan_drawing_image')">
              <template v-if="tabData.DesignDrawings.plan_drawing_image.length">
                <div class="file-name" v-for="(item, index) in tabData.DesignDrawings
                  .plan_drawing_image" :key="index" @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="平面图文件" v-if="fieldShowFunc('plan_drawing')">
              <template v-if="tabData.DesignDrawings.plan_drawing.length">
                <div class="file-name" v-for="(item, index) in tabData.DesignDrawings.plan_drawing" :key="index"
                  @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="效果图" v-if="fieldShowFunc('effect_drawing_image')">
              <template v-if="tabData.DesignDrawings.effect_drawing_image.length">
                <div class="file-name" v-for="(item, index) in tabData.DesignDrawings
                  .effect_drawing_image" :key="index" @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="效果文件" v-if="fieldShowFunc('effect_drawing')">
              <template v-if="tabData.DesignDrawings.effect_drawing.length">
                <div class="file-name" v-for="(item, index) in tabData.DesignDrawings.effect_drawing" :key="index"
                  @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>

            <el-descriptions-item label="施工图" v-if="fieldShowFunc('construction_drawing_image')">
              <template v-if="tabData.DesignDrawings.construction_drawing_image.length">
                <div class="file-name" v-for="(item, index) in tabData.DesignDrawings
                  .construction_drawing_image" :key="index" @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="施工图文件" v-if="fieldShowFunc('construction_drawing')">
              <template v-if="tabData.DesignDrawings.construction_drawing.length">
                <div class="file-name" v-for="(item, index) in tabData.DesignDrawings
                  .construction_drawing" :key="index" @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="其他文件" v-if="fieldShowFunc('other_file')">
              <template v-if="tabData.DesignDrawings.other_file.length">
                <div class="file-name" v-for="(item, index) in tabData.DesignDrawings.other_file" :key="index"
                  @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
          </el-descriptions>
        </div>
      </transition>

      <transition name="fade">
        <div class="left-item" v-if="tabActive == 3 && tabData">
          <div class="title-box" v-if="bjxxItemShow">报价信息</div>
          <el-descriptions v-if="bjxxItemShow" title="" direction="horizontal" :column="3" border>
            <el-descriptions-item label="造价员" v-if="fieldShowFunc('cost_estimator_name')">
              {{ tabData.cost_estimator_name || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="申请报价日期" v-if="fieldShowFunc('bj_created_at')">
              {{ tabData.created_at || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="最终报价日期" v-if="fieldShowFunc('completion_at')">
              {{ tabData.completion_at || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="预计开工日期" v-if="fieldShowFunc('start_date')">
              {{ tabData.start_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="预计完工日期" v-if="fieldShowFunc('end_date')">
              {{ tabData.end_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="工期" v-if="fieldShowFunc('duration_days')">
              {{ tabData.duration_days ? tabData.duration_days + "天" : "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="项目面积" v-if="fieldShowFunc('building_area')">
              {{ tabData.building_area ? tabData.building_area + "m²" : "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="报价金额" v-if="fieldShowFunc('quotation_amount')">
              {{
                tabData.quotation_amount
                  ? tabData.quotation_amount + "元"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="基础装修费" v-if="fieldShowFunc('basic_decoration_fee')">
              {{
                tabData.basic_decoration_fee
                  ? tabData.basic_decoration_fee + "元"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="主材采购费" v-if="fieldShowFunc('material_costs')">
              {{
                tabData.material_costs ? tabData.material_costs + "元" : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="税金" v-if="fieldShowFunc('quotation_taxes')">
              {{
                tabData.quotation_taxes ? tabData.quotation_taxes + "元" : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="成本金额" v-if="fieldShowFunc('cost_amount')">
              {{ tabData.cost_amount ? tabData.cost_amount + "元" : "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="现场采购成本" v-if="fieldShowFunc('procurement_cost')">
              {{
                tabData.procurement_cost
                  ? tabData.procurement_cost + "元"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="公司集采成本" v-if="fieldShowFunc('centralized_procurement_cost')">
              {{
                tabData.centralized_procurement_cost
                  ? tabData.centralized_procurement_cost + "元"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="管理成本" v-if="fieldShowFunc('management_costs')">
              {{
                tabData.management_costs
                  ? tabData.management_costs + "元"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="利润金额" v-if="fieldShowFunc('profit_amount')">
              {{ tabData.profit_amount ? tabData.profit_amount + "元" : "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="报价附件" v-if="fieldShowFunc('quotation_file')">
              <template v-if="tabData.quotation_file.length">
                <div class="file-name" v-for="(item, index) in tabData.quotation_file" :key="index"
                  @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="成本附件" v-if="fieldShowFunc('cost_list_file')">
              <template v-if="tabData.cost_list_file.length">
                <div class="file-name" v-for="(item, index) in tabData.cost_list_file" :key="index"
                  @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="利润附件" v-if="fieldShowFunc('profit_statement_file')">
              <template v-if="tabData.profit_statement_file.length">
                <div class="file-name" v-for="(item, index) in tabData.profit_statement_file" :key="index"
                  @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
          </el-descriptions>
          <div class="title2" v-if="zjxxxItemShow">增减项列表</div>
          <el-table v-if="zjxxxItemShow" :header-cell-style="headerCellStyle" :data="zjTableData" style="width: 100%">
            <el-table-column v-if="fieldShowFunc('zj_cost_estimator_name')" prop="quotation.cost_estimator_name"
              label="造价员" width="120"></el-table-column>
            <el-table-column v-if="fieldShowFunc('increase_or_decrease')" prop="increase_or_decrease" label="增减类型"
              width="200">
              <template slot-scope="scope">
                {{ scope.row.increase_or_decrease == 1 ? "增项" : "减项" }}
              </template>
            </el-table-column>
            <el-table-column width="120" v-if="fieldShowFunc('change_content')" prop="change_content" label="增减内容">
              <template slot-scope="scope">
                <span v-if="scope.row.change_content == 1">顶面工程</span>
                <span v-if="scope.row.change_content == 2">地面工程</span>
                <span v-if="scope.row.change_content == 3">墙面工程</span>
                <span v-if="scope.row.change_content == 4">水电工程</span>
                <span v-if="scope.row.change_content == 5">楼梯工程</span>
                <span v-if="scope.row.change_content == 6">广告工程</span>
                <span v-if="scope.row.change_content == 7">外立面工程</span>
                <span v-if="scope.row.change_content == 8">其他工程</span>
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('zj_created_at')" prop="created_at" label="申请报价日期"
              width="200"></el-table-column>
            <el-table-column v-if="fieldShowFunc('final_quotation_time')" prop="final_quotation_time" label="最终报价日期"
              width="200">
              <template slot-scope="scope">
                {{ scope.row.final_quotation_time || "--" }}
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('expect_duration_days')" prop="expect_duration_days" label="预计工期"
              width="120">
              <template slot-scope="scope">
                {{
                  scope.row.expect_duration_days
                    ? scope.row.expect_duration_days + "天"
                    : "--"
                }}
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('zj_quotation_amount')" prop="quotation.quotation_amount" label="报价金额"
              width="120">
              <template slot-scope="scope">
                {{
                  scope.row.quotation.quotation_amount
                    ? scope.row.quotation.quotation_amount + "元"
                    : "--"
                }}
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('zj_basic_decoration_fee')" prop="quotation.basic_decoration_fee"
              label="基础装修费" width="120">
              <template slot-scope="scope">
                {{
                  scope.row.basic_decoration_fee
                    ? scope.row.basic_decoration_fee + "元"
                    : "--"
                }}
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('zj_material_costs')" prop="quotation.material_costs" label="主材采购费"
              width="120">
              <template slot-scope="scope">
                {{
                  scope.row.material_costs
                    ? scope.row.material_costs + "元"
                    : "--"
                }}
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('zj_cost_amount')" prop="quotation.cost_amount" label="成本金额"
              width="120">
              <template slot-scope="scope">
                {{
                  scope.row.quotation.cost_amount
                    ? scope.row.quotation.cost_amount + "元"
                    : "--"
                }}
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('zj_quotation_taxes')" prop="quotation.quotation_taxes" label="税金"
              width="120">
              <template slot-scope="scope">
                {{
                  scope.row.quotation.quotation_taxes
                    ? scope.row.quotation.quotation_taxes + "元"
                    : "--"
                }}
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('zj_procurement_cost')" prop="quotation.procurement_cost"
              label="现场采购成本" width="120">
              <template slot-scope="scope">
                {{
                  scope.row.quotation.procurement_cost
                    ? scope.row.quotation.procurement_cost + "元"
                    : "--"
                }}
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('zj_centralized_procurement_cost')"
              prop="quotation.centralized_procurement_cost" label="公司集采成本" width="120">
              <template slot-scope="scope">
                {{
                  scope.row.quotation.centralized_procurement_cost
                    ? scope.row.quotation.centralized_procurement_cost + "元"
                    : "--"
                }}
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('zj_management_costs')" prop="quotation.management_costs" label="管理成本"
              width="120">
              <template slot-scope="scope">
                {{
                  scope.row.quotation.management_costs
                    ? scope.row.quotation.management_costs + "元"
                    : "--"
                }}
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('zj_profit_amount')" prop="quotation.profit_amount" label="利润金额"
              width="120">
              <template slot-scope="scope">
                {{
                  scope.row.quotation.profit_amount
                    ? scope.row.quotation.profit_amount + "元"
                    : "--"
                }}
              </template>
            </el-table-column>
            <el-table-column width="120" v-if="fieldShowFunc('zj_change_file')" prop="quotation.quotation_file"
              label="增减项附件">
              <template slot-scope="scope">
                <template v-if="scope.row.change_file.length">
                  <div class="file-name" v-for="(item, index) in scope.row.change_file" :key="index"
                    @click="$fileViewHandle(item)">
                    {{ item.file_name }}
                  </div>
                </template>
                <template v-else>--</template>
              </template>
            </el-table-column>
            <!-- <el-table-column width="120" v-if="fieldShowFunc('zj_quotation_file')" prop="quotation.quotation_file"
              label="报价单附件">
              <template slot-scope="scope">
                <template v-if="scope.row.quotation_file.length">
                  <div class="file-name" v-for="(item, index) in scope.row.quotation_file" :key="index"
                    @click="$fileViewHandle(item)">
                    {{ item.file_name }}
                  </div>
                </template>
                <template v-else>--</template>
              </template>
            </el-table-column>
            <el-table-column width="120" v-if="fieldShowFunc('zj_profit_statement_file')"
              prop="quotation.profit_statement_file" label="利润单附件">
              <template slot-scope="scope">
                <template v-if="scope.row.profit_statement_file.length">
                  <div class="file-name" v-for="(item, index) in scope.row
                    .profit_statement_file" :key="index" @click="$fileViewHandle(item)">
                    {{ item.file_name }}
                  </div>
                </template>
                <template v-else>--</template>
              </template>
            </el-table-column>
            <el-table-column width="120" v-if="fieldShowFunc('zj_cost_list_file')" prop="quotation.cost_list_file"
              label="成本单附件">
              <template slot-scope="scope">
                <template v-if="scope.row.cost_list_file.length">
                  <div class="file-name" v-for="(item, index) in scope.row.cost_list_file" :key="index"
                    @click="$fileViewHandle(item)">
                    {{ item.file_name }}
                  </div>
                </template>
                <template v-else>--</template>
              </template>
            </el-table-column> -->
            <el-table-column width="200" prop="remark" label="备注" v-if="fieldShowFunc('zj_desc')">
              <template slot-scope="scope">
                {{ scope.row.remark || "--" }}
              </template>
            </el-table-column>
            <el-table-column width="120" prop="quotation_amount" label="操作" fixed="right">
              <template slot-scope="scope">
                <el-button type="text" @click="handleEdit({ index: scope.$index, item: scope.row })">详情</el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </transition>

      <transition name="fade">
        <div class="left-item" v-if="tabActive == 4 && tabData">
          <div class="title-box">合同信息</div>
          <el-descriptions title="" direction="horizontal" :column="3" border>
            <el-descriptions-item label="合同签约日期" v-if="fieldShowFunc('signing_date')">
              {{ tabData.signing_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="签约主体" v-if="fieldShowFunc('account_name')">
              {{ tabData.account_name || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="最终报价金额" v-if="fieldShowFunc('system_quotation')">
              {{
                tabData.system_quotation
                  ? tabData.system_quotation + "元"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="合同签约金额" v-if="fieldShowFunc('contract_price')">
              {{
                tabData.contract_price ? tabData.contract_price + "元" : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="合同报价比" v-if="fieldShowFunc('contract_quotation_ratio')">
              {{
                tabData.contract_quotation_ratio
                  ? tabData.contract_quotation_ratio + "%"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="合同利润率" v-if="fieldShowFunc('contract_profit_margin')">
              {{
                tabData.contract_profit_margin
                  ? tabData.contract_profit_margin + "%"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="合同开工日期" v-if="fieldShowFunc('contract_commencement_date')">
              {{ tabData.contract_commencement_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="合同完工日期" v-if="fieldShowFunc('contract_completion_date')">
              {{ tabData.contract_completion_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="合同工期" v-if="fieldShowFunc('contract_duration_days')">
              {{
                tabData.contract_duration_days
                  ? tabData.contract_duration_days + "天"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="签约流程时效" v-if="fieldShowFunc('term_validity')">
              <template v-if="tabData.term_validity">
                {{ tabData.term_validity < 0 ? 0 : tabData.term_validity }} </template>
                  <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="结算完成日期" v-if="fieldShowFunc('settlement_completion_date')">
              {{ tabData.settlement_completion_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="合同附件" v-if="fieldShowFunc('contract_files')">
              <template v-if="tabData.contract_files.length">
                <div class="file-name" v-for="(item, index) in tabData.contract_files" :key="index"
                  @click="$fileViewHandle(item)">
                  {{ item.file_name }}
                </div>
              </template>
              <template v-else>--</template>
            </el-descriptions-item>
            <el-descriptions-item label="签约备注" v-if="fieldShowFunc('ht_remark')">
              {{ tabData.remark || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="取消日期" v-if="fieldShowFunc('cancel_at')">
              {{ tabData.cancel_at || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="取消类型" v-if="fieldShowFunc('cancel_type')">
              <span v-if="tabData.cancel_type == 1">价格原因</span>
              <span v-if="tabData.cancel_type == 2">工期原因</span>
              <span v-if="tabData.cancel_type == 3">客户拒绝沟通</span>
              <span v-if="tabData.cancel_type == 4">客户自行施工</span>
              <span v-if="tabData.cancel_type == 5">不可抗力因素</span>
              <span v-if="tabData.cancel_type == 6">前施工问题影响</span>
              <span v-if="tabData.cancel_type == 7">客户关联</span>
              <span v-if="tabData.cancel_type == 8">其他原因</span>
              <span v-if="
                tabData.cancel_type != 1 &&
                tabData.cancel_type != 2 &&
                tabData.cancel_type != 3 &&
                tabData.cancel_type != 4 &&
                tabData.cancel_type != 5 &&
                tabData.cancel_type != 6 &&
                tabData.cancel_type != 7 &&
                tabData.cancel_type != 8
              ">--</span>
            </el-descriptions-item>
            <el-descriptions-item label="取消原因描述" v-if="fieldShowFunc('cancel_reason')">
              {{ tabData.cancel_reason || "--" }}
            </el-descriptions-item>
          </el-descriptions>
        </div>
      </transition>

      <transition name="fade">
        <div class="left-item" v-if="tabActive == 5 && tabData">
          <div class="title-box" v-if="sgxxItemShow">施工信息</div>
          <el-descriptions style="margin-bottom: 20px" v-if="sgxxItemShow" title="" direction="horizontal" :column="3"
            border>
            <el-descriptions-item label="施工工程经理" v-if="fieldShowFunc('engineering_manager_name')">
              {{ detailData.engineering_manager_name || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="工程监理" v-if="fieldShowFunc('engineering_supervision_name')">
              {{ detailData.engineering_supervision_name || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="工长" v-if="fieldShowFunc('foreman_name')">
              {{ detailData.foreman_name || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="施工进度" v-if="fieldShowFunc('construction_progress')">
              <span v-if="tabData.construction_status == 42">待进场</span>
              <span v-if="tabData.construction_status == 45">施工中</span>
              <span v-if="tabData.construction_status == 50">已完工</span>
              <span v-if="
                tabData.construction_status != 42 &&
                tabData.construction_status != 45 &&
                tabData.construction_status != 50
              ">--</span>
            </el-descriptions-item>
            <el-descriptions-item label="实际开工日期" v-if="fieldShowFunc('on_site_start_date')">
              {{ tabData.on_site_start_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="实际完工日期" v-if="fieldShowFunc('actual_completion_date')">
              {{ tabData.actual_completion_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="当前工期" v-if="fieldShowFunc('current_duration')">
              {{
                tabData.current_duration
                  ? tabData.current_duration + "天"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="实际工期" v-if="fieldShowFunc('actual_duration')">
              {{
                tabData.actual_duration ? tabData.actual_duration + "天" : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="超期类型" v-if="fieldShowFunc('overdue_type')">
              <span v-if="tabData.overdue_type == 1">客户原因</span>
              <span v-if="tabData.overdue_type == 2">供应商原因</span>
              <span v-if="tabData.overdue_type == 3">物业原因</span>
              <span v-if="tabData.overdue_type == 4">城管审批</span>
              <span v-if="tabData.overdue_type == 5">不可抗力</span>
              <span v-if="tabData.overdue_type == 6">现场管理</span>
              <span v-if="tabData.overdue_type == 7">图纸变更</span>
              <span v-if="tabData.overdue_type == 8">其他原因</span>
              <span v-if="
                tabData.overdue_type != 1 &&
                tabData.overdue_type != 2 &&
                tabData.overdue_type != 3 &&
                tabData.overdue_type != 4 &&
                tabData.overdue_type != 5 &&
                tabData.overdue_type != 6 &&
                tabData.overdue_type != 7 &&
                tabData.overdue_type != 8
              ">--</span>
            </el-descriptions-item>
            <el-descriptions-item label="超期原因" v-if="fieldShowFunc('reason_overdue')">
              {{ tabData.reason_overdue || "--" }}
            </el-descriptions-item>
          </el-descriptions>
          <!-- <div
            class="title-box"
            style="margin-top: 20px"
            v-if="constructionLogs.length && sgrzImteShow"
          >
          </div> -->
          <!-- 节点验收 -->
          <template v-if="fieldShowFunc('project_nodes')">
            <template v-for="(item, index) in detailData.project_nodes">
              <div class="title2 flex ac" :key="index + 'title'">
                {{ item.node_name }}
                <el-tooltip placement="top" v-if="item.remark">
                  <div slot="content">
                    <span>备注</span><br />
                    <div class="rule-box">
                      {{ item.remark }}<br />
                      <!-- 2、提示内容<br />
                    3、提示内容 -->
                    </div>
                  </div>
                  <i class="el-icon-question"></i>
                </el-tooltip>
                <el-tag class="el-tag-box2" v-if="item.node_status == 1">待提交</el-tag>
                <el-tag class="el-tag-box2" v-if="item.node_status == 2 || item.node_status == 3">待验收</el-tag>
                <el-tag class="el-tag-box" v-if="item.node_status > 4 || item.node_status == 4">已验收</el-tag>
              </div>
              <el-descriptions title="" direction="horizontal" :column="3" border :key="index + 'descriptions'">
                <template v-for="(child, childIndex) in item.children">
                  <el-descriptions-item v-if="child.content_type == 1" :key="childIndex" :label="child.node_name">
                    {{ child.content || "--" }}
                  </el-descriptions-item>
                  <el-descriptions-item v-else :key="childIndex" :label="child.node_name">
                    <template v-if="child.node_files.length">
                      <div class="file-name" v-for="(item, index) in child.node_files" :key="index"
                        @click="$fileViewHandle(item)">
                        {{ item.file_name }}
                      </div>
                    </template>
                    <span v-else>--</span>
                  </el-descriptions-item>
                </template>
              </el-descriptions>
            </template>
          </template>
          <!-- 施工日志 -->
          <div class="title-box" style="margin-top: 20px" v-if="sgrzImteShow">
            施工日志
          </div>
          <el-table v-if="sgrzImteShow" :header-cell-style="headerCellStyle" :data="constructionLogs"
            style="width: 100%" max-height="calc(100vh - 400px)" border>
            <el-table-column fixed prop="construction_progress" label="施工进度"
              v-if="fieldShowFunc('sg_construction_progress')">
              <template slot-scope="scope">
                <template v-if="scope.row.construction_progress == 10">待进场</template>
                <template v-if="scope.row.construction_progress == 20">施工中</template>
                <template v-if="scope.row.construction_progress == 30">一次预警</template>
                <template v-if="scope.row.construction_progress == 40">二次预警</template>
                <template v-if="scope.row.construction_progress == 50">已超期</template>
                <template v-if="scope.row.construction_progress == 60">停工中</template>
                <template v-if="scope.row.construction_progress == 70">已完工</template>
              </template>
            </el-table-column>
            <el-table-column fixed prop="is_overdue" label="是否超期" v-if="fieldShowFunc('is_overdue')">
              <template slot-scope="scope">
                {{ scope.row.is_overdue == 1 ? "是" : "否" }}
              </template>
            </el-table-column>
            <el-table-column fixed prop="overdue_type" label="超期类型" v-if="fieldShowFunc('sg_overdue_type')">
              <template slot-scope="scope">
                <template v-if="scope.row.overdue_type == 0">--</template>
                <template v-if="scope.row.overdue_type == 1">客户原因</template>
                <template v-if="scope.row.overdue_type == 2">供应商原因</template>
                <template v-if="scope.row.overdue_type == 3">物业原因</template>
                <template v-if="scope.row.overdue_type == 4">城管审批</template>
                <template v-if="scope.row.overdue_type == 5">不可抗力</template>
                <template v-if="scope.row.overdue_type == 6">现场管理</template>
                <template v-if="scope.row.overdue_type == 7">图纸变更</template>
                <template v-if="scope.row.overdue_type == 8">其他原因</template>
              </template>
            </el-table-column>
            <el-table-column fixed prop="reason_overdue" label="超期原因" v-if="fieldShowFunc('sg_reason_overdue')">
              <template slot-scope="scope">
                {{ scope.row.reason_overdue || "--" }}
              </template>
            </el-table-column>
            <el-table-column fixed prop="construction_stage" label="施工阶段" v-if="fieldShowFunc('construction_stage')">
              <template slot-scope="scope">
                {{ scope.row.construction_stage || "--" }}
              </template>
            </el-table-column>
            <el-table-column fixed prop="content" label="施工内容" v-if="fieldShowFunc('sg_content')">
              <template slot-scope="scope">
                {{ scope.row.content || "--" }}
              </template>
            </el-table-column>
            <el-table-column fixed prop="remark" label="备注" v-if="fieldShowFunc('sg_remark')">
              <template slot-scope="scope">
                {{ scope.row.remark || "--" }}
              </template>
            </el-table-column>
            <el-table-column fixed prop="construction_files" label="日志文件" v-if="fieldShowFunc('sg_log_file')">
              <template slot-scope="scope">
                <template v-if="scope.row.construction_files.length">
                  <div @click="$fileViewHandle(file)" class="file-name"
                    v-for="(file, fileIndex) in scope.row.construction_files" :key="fileIndex">
                    {{ file.file_name }}
                  </div>
                </template>
                <template v-else>--</template>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </transition>

      <transition name="fade">
        <div class="left-item" v-if="tabActive == 6 && tabData">
          <div class="title-box">收款信息</div>
          <el-table :header-cell-style="headerCellStyle" :data="tabData" style="width: 100%"
            max-height="calc(100vh - 400px)" border>
            <el-table-column fixed prop="payment_type" label="收款类型" v-if="fieldShowFunc('payment_type')">
              <template slot-scope="scope">
                <span v-if="scope.row.payment_type == 1">勘场费用</span>
                <span v-if="scope.row.payment_type == 2">预付款</span>
                <span v-if="scope.row.payment_type == 3">进度款</span>
                <span v-if="scope.row.payment_type == 4">尾款</span>
                <span v-if="scope.row.payment_type == 5">增项款</span>
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('receiving_account')" fixed prop="receiving_account"
              label="账户名称"></el-table-column>
            <el-table-column v-if="fieldShowFunc('account_number')" fixed prop="account_number"
              label="收款账户"></el-table-column>
            <el-table-column v-if="fieldShowFunc('amount_collected')" fixed prop="amount_collected" label="收款金额">
              <template slot-scope="scope">
                {{
                  scope.row.amount_collected
                    ? scope.row.amount_collected + "元"
                    : "--"
                }}
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('voucher_file')" fixed prop="voucher_file" label="收款凭证">
              <template slot-scope="scope">
                <template v-if="scope.row.voucher_file.length">
                  <div class="file-name" v-for="(item, index) in scope.row.voucher_file" :key="index"
                    @click="$fileViewHandle(item)">
                    {{ item.file_name }}
                  </div>
                </template>
                <template v-else>--</template>
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('review_status')" fixed prop="review_status" label="收款状态">
              <template slot-scope="scope">
                <span v-if="scope.row.review_status == 1">待审核</span>
                <span v-if="scope.row.review_status == 2">已收款</span>
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('sk_created_at')" fixed prop="created_at"
              label="收款时间"></el-table-column>
          </el-table>
        </div>
      </transition>

      <transition name="fade">
        <div class="left-item" v-if="tabActive == 7 && tabData">
          <div class="title-box" v-if="wbxxImteShow">维保信息</div>
          <el-descriptions v-if="wbxxImteShow" title="" direction="horizontal" :column="2" border>
            <el-descriptions-item label="质保截止日期" v-if="fieldShowFunc('warranty_deadline_date')">
              {{ tabData.warranty_deadline_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="是否质保期" v-if="fieldShowFunc('is_sell_by')">
              <template v-if="tabData.is_sell_by == 0">--</template>
              <template v-if="tabData.is_sell_by == 1">是</template>
              <template v-if="tabData.is_sell_by == 2">否</template>
            </el-descriptions-item>
          </el-descriptions>
          <div class="title2" v-if="wbjlImteShow">维保记录</div>
          <el-table v-if="wbjlImteShow" :header-cell-style="headerCellStyle" :data="tabData.list" style="width: 100%"
            max-height="300" border>
            <el-table-column v-if="fieldShowFunc('problem_content')" fixed prop="problem_content"
              label="内容描述"></el-table-column>
            <el-table-column v-if="fieldShowFunc('user_name')" fixed prop="user_name" label="发起人"></el-table-column>
            <el-table-column width="200" v-if="fieldShowFunc('after_sales_status')" fixed prop="after_sales_status"
              label="售后状态">
              <template slot-scope="scope">
                <span v-if="scope.row.after_sales_status == 10">待分配工程监理</span>
                <span v-if="scope.row.after_sales_status == 20">待分配工程经理</span>
                <span v-if="scope.row.after_sales_status == 30">待工程经理反馈现场情况</span>
                <span v-if="scope.row.after_sales_status == 40">待责任判定</span>
                <span v-if="scope.row.after_sales_status == 50">待整改</span>
                <span v-if="scope.row.after_sales_status == 60">工程经理提交完成情况</span>
              </template>
            </el-table-column>
            <el-table-column v-if="fieldShowFunc('after_sales_timeliness')" fixed prop="after_sales_timeliness"
              label="售后时效"></el-table-column>
            <el-table-column v-if="fieldShowFunc('wb_created_at')" fixed prop="created_at"
              label="创建时间"></el-table-column>
            <el-table-column v-if="fieldShowFunc('wb_completion_date')" fixed prop="completion_date"
              label="完成时间"></el-table-column>
            <el-table-column prop="address" label="操作" width="150">
              <template slot-scope="scope">
                <el-button type="text" @click="handleEdit_({ index: scope.$index, item: scope.row })">详情</el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </transition>

      <transition name="fade">
        <div class="left-item" style="margin-bottom: 0" v-if="tabActive == 9 && tabData">
          <div class="title-box">结算信息</div>
          <el-descriptions title="" direction="horizontal" :column="3" border>
            <el-descriptions-item label="出具结算单日期" v-if="fieldShowFunc('settlement_completion_start_date')">
              {{ tabData.settlement_completion_start_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="结算完成日期" v-if="fieldShowFunc('js_settlement_completion_date')">
              {{ tabData.settlement_completion_date || "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="合同签约金额" v-if="fieldShowFunc('js_contract_price')">
              {{
                tabData.contract_price ? tabData.contract_price + "元" : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="增减项总金额" v-if="fieldShowFunc('changes_amount')">
              {{
                tabData.changes_amount ? tabData.changes_amount + "元" : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="应结算金额" v-if="fieldShowFunc('settlement_amount')">
              {{
                tabData.settlement_amount
                  ? tabData.settlement_amount + "元"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="现场采购成本" v-if="fieldShowFunc('js_procurement_cost')">
              {{
                tabData.procurement_cost
                  ? tabData.procurement_cost + "元"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="公司集采成本" v-if="fieldShowFunc('js_centralized_procurement_cost')">
              {{
                tabData.centralized_procurement_cost
                  ? tabData.centralized_procurement_cost + "元"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="管理成本" v-if="fieldShowFunc('js_management_costs')">
              {{
                tabData.management_costs
                  ? tabData.management_costs + "元"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="利润金额" v-if="fieldShowFunc('js_profit_amount')">
              {{ tabData.profit_amount ? tabData.profit_amount + "元" : "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="已付款金额" v-if="fieldShowFunc('js_paid_amount')">
              {{ tabData.paid_amount ? tabData.paid_amount + "元" : "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="待付款金额" v-if="fieldShowFunc('js_unpaid_amount')">
              {{ tabData.unpaid_amount ? tabData.unpaid_amount + "元" : "--" }}
            </el-descriptions-item>
            <el-descriptions-item label="结算税金" v-if="fieldShowFunc('js_settlement_taxes')">
              {{
                tabData.settlement_taxes
                  ? tabData.settlement_taxes + "元"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="成本金额" v-if="fieldShowFunc('js_settlement_cost_amount')">
              {{
                tabData.settlement_cost_amount
                  ? tabData.settlement_cost_amount + "元"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="利润率" v-if="fieldShowFunc('js_settlement_profit_margin')">
              {{
                tabData.settlement_profit_margin
                  ? tabData.settlement_profit_margin + "%"
                  : "--"
              }}
            </el-descriptions-item>
            <el-descriptions-item label="项目结算单" v-if="fieldShowFunc('js_settlement_file')">
              <div @click="$fileViewHandle(item)" class="file-name" v-for="(item, index) in tabData.settlement_file"
                :key="index">
                {{ item.file_name }}
              </div>
              <div v-if="!tabData.settlement_file.length">--</div>
            </el-descriptions-item>
            <el-descriptions-item label="工程量清单" v-if="fieldShowFunc('js_inventory_file')">
              <div @click="$fileViewHandle(item)" class="file-name" v-for="(item, index) in tabData.inventory_file"
                :key="index">
                {{ item.file_name }}
              </div>
              <div v-if="!tabData.inventory_file.length">--</div>
            </el-descriptions-item>
            <el-descriptions-item label="利润单" v-if="fieldShowFunc('js_profit_statement_file')">
              <div @click="$fileViewHandle(item)" class="file-name"
                v-for="(item, index) in tabData.profit_statement_file" :key="index">
                {{ item.file_name }}
              </div>
              <div v-if="!tabData.profit_statement_file.length">--</div>
            </el-descriptions-item>
            <el-descriptions-item label="备注" v-if="fieldShowFunc('js_desc')">
              {{ tabData.remark || "--" }}
            </el-descriptions-item>
          </el-descriptions>
        </div>
      </transition>
    </div>
    <!-- 项目历史记录 -->
    <projectLogCom :fieldList="fieldList" :logLoaidng="logLoaidng" @tabClick="tabClick" :activeName="activeName"
      :addDialogVisible="hisDrawer" :log_list="logList" @close="hisDrawer = false">
    </projectLogCom>
    <!-- 分配客户经理 -->
    <fpkhjlCom :project_id="this.detailData.id" :addDialogVisible="fpkhjlVisible" @onClose="fpkhjlVisible = false"
      @onSuccess="onSuccess"></fpkhjlCom>
    <!-- 提交勘场凭证 -->
    <kcxxCom :project_id="this.detailData.id" :addDialogVisible="kcxxVisible" @onClose="kcxxVisible = false"
      @onSuccess="onSuccess"></kcxxCom>
    <!-- 勘场费打款确认 -->
    <kcfdkqrCom :shkxpzData="shkxpzData" :project_id="this.detailData.id" :addDialogVisible="kcfdkqrVisible"
      @onClose="kcfdkqrVisible = false" :fieldList="fieldList" @onSuccess="onSuccess"></kcfdkqrCom>
    <!-- 分配工程经理 -->
    <fpgcjCom :project_id="this.detailData.id" :detailData="detailData" :addDialogVisible="fpgcjVisible"
      @onClose="fpgcjVisible = false" @onSuccess="onSuccess"></fpgcjCom>
    <!-- 提交勘场报告 -->
    <tjkcxxCom :project_id="this.detailData.id" :addDialogVisible="tjkcxxVisible" @onClose="tjkcxxVisible = false"
      @onSuccess="onSuccess"></tjkcxxCom>
    <!-- 上传勘场资料 -->
    <shkczlCom :project_id="this.detailData.id" :addDialogVisible="shkczlVisible" @onClose="shkczlVisible = false"
      @onSuccess="onSuccess"></shkczlCom>
    <!-- 对客日志 -->
    <dkrzCom :project_id="this.detailData.id" :addDialogVisible="dkrzVisible" @onClose="dkrzVisible = false"
      @onSuccess="onSuccess"></dkrzCom>
    <!-- 完善项目 -->
    <addProjectCom :addData="addFormInline" :addDialogVisible="addDialogVisible" @cancelFunc="cancelFunc"
      @addProjectSuccess="addProjectSuccess" :detailData="detailData" :surveySiteDisabled="surveySiteDisabled">
    </addProjectCom>
    <!-- 上传设计图 -->
    <scsjtCom :project_id="this.detailData.id" :addDialogVisible="scsjtVisible" @onClose="scsjtVisible = false"
      @onSuccess="onSuccess"></scsjtCom>
    <!-- 申请报价 -->
    <sqbjCom :project_id="this.detailData.id" :addDialogVisible="sqbjVisible" @onClose="sqbjVisible = false"
      @onSuccess="onSuccess"></sqbjCom>
    <!-- 分配造价员 -->
    <fpzjyCom :project_id="this.detailData.id" :addDialogVisible="fpzjyVisible" @onClose="fpzjyVisible = false"
      @onSuccess="onSuccess"></fpzjyCom>
    <!-- 工程经理拒绝接单 -->
    <gcjljjjdCom :project_id="this.detailData.id" :addDialogVisible="gcjljjjdVisible" @onClose="gcjljjjdVisible = false"
      @onSuccess="onSuccess"></gcjljjjdCom>
    <!-- 出具造价单 -->
    <cjzjdCom :project_id="this.detailData.id" :addDialogVisible="cjzjdVisible" @onClose="cjzjdVisible = false"
      @onSuccess="onSuccess" :hisQuotationData="hisQuotationData" :startEndDate="startEndDate"></cjzjdCom>
    <!-- 审核造价单 -->
    <shbjdCom :project_id="this.detailData.id" :addDialogVisible="shbjdVisible" @onClose="shbjdVisible = false"
      @onSuccess="onSuccess" :fieldList="fieldList" :hisQuotationData="hisQuotationData"></shbjdCom>
    <!-- 对客报价 -->
    <dkbjCom :project_id="this.detailData.id" :addDialogVisible="dkbjVisible" @onClose="dkbjVisible = false"
      @onSuccess="onSuccess" :zjData="zjData"></dkbjCom>
    <!-- 项目取消 -->
    <xmqxCom :project_id="this.detailData.id" :addDialogVisible="xmqxVisible" @onClose="xmqxVisible = false"
      @onSuccess="onSuccess"></xmqxCom>
    <!-- 审核对客报价单 -->
    <shdkbjdCom :project_id="this.detailData.id" :addDialogVisible="shdkbjdVisible" @onClose="shdkbjdVisible = false"
      @onSuccess="onSuccess" :fieldList="fieldList" :dkData="dkData"></shdkbjdCom>
    <!-- 提交签订合同 -->
    <tjqdhtCom :project_id="this.detailData.id" :addDialogVisible="tjqdhtVisible" @onClose="tjqdhtVisible = false"
      @onSuccess="onSuccess" :zjData="zjData" :dkData="dkData"></tjqdhtCom>
    <!-- 提交预付款凭证 -->
    <tjyfkpzCom :project_id="this.detailData.id" :addDialogVisible="tjyfkpzVisible"
      :signing_company_data="signing_company_data" @onClose="tjyfkpzVisible = false" @onSuccess="onSuccess">
    </tjyfkpzCom>
    <!-- 预付款确认 -->
    <yfkdkqrCom :project_id="this.detailData.id" :addDialogVisible="yfkdkqrVisible" :yfkpzData="yfkpzData"
      :fieldList="fieldList" @onClose="yfkdkqrVisible = false" @onSuccess="onSuccess"></yfkdkqrCom>
    <!-- 开始施工确认 -->
    <qrkssgCom :project_id="this.detailData.id" :addDialogVisible="qrkssgVisible" @onClose="qrkssgVisible = false"
      @onSuccess="onSuccess"></qrkssgCom>
    <!-- 节点验收 -->
    <jdysCom :project_id="this.detailData.id" :addDialogVisible="jdysVisible" @onClose="jdysVisible = false"
      @onSuccess="onSuccess" :jdysRules="jdysRules" :jdysRuleForm="jdysRuleForm" :jdysFormList="jdysFormList"
      :projectNodesItem="projectNodesItem"></jdysCom>
    <!-- 节点验收审核 -->
    <jdysshCom :project_id="this.detailData.id" :addDialogVisible="jdysshVisible" :jdysArrData="jdysArrData"
      @onClose="jdysshVisible = false" @onSuccess="onSuccess" :projectNodesItem="projectNodesItem"></jdysshCom>
    <!-- 提交进度款凭证 -->
    <tjjdkpzCom :project_id="this.detailData.id" :addDialogVisible="tjjdkpzVisible"
      :signing_company_data="signing_company_data" @onClose="tjjdkpzVisible = false" @onSuccess="onSuccess">
    </tjjdkpzCom>
    <!-- 进度款凭证确认 -->
    <jdkqrCom :project_id="this.detailData.id" :addDialogVisible="jdkqrVisible" :jdkpzData="jdkpzData"
      @onClose="jdkqrVisible = false" @onSuccess="onSuccess"></jdkqrCom>
    <!-- 提交施工日志 -->
    <sgjlCom :project_id="this.detailData.id" :addDialogVisible="sgjlVisible" @onClose="sgjlVisible = false"
      @onSuccess="onSuccess" :projectNodesItem="projectNodesItem"></sgjlCom>
    <!-- 确认增减项 -->
    <qrzjxCom :project_id="this.detailData.id" :addDialogVisible="qrzjxVisible" @onClose="qrzjxVisible = false"
      @onSuccess="onSuccess"></qrzjxCom>
    <!--  出具结算单 -->
    <cjjsdCom :detailData="detailData" :project_id="this.detailData.id" :signing_company_data="signing_company_data"
      :addDialogVisible="cjjsdVisible" @onClose="cjjsdVisible = false" @onSuccess="onSuccess"></cjjsdCom>
    <!-- 审核结算单 -->
    <shjsdCom :detailData="detailData" :project_id="this.detailData.id" :addDialogVisible="shjsdVisible"
      @onClose="shjsdVisible = false" :jsdData="jsdData" :fieldList="fieldList" @onSuccess="onSuccess"></shjsdCom>
    <!-- 提交尾款凭证 -->
    <tjwkpzCom :detailData="detailData" :project_id="this.detailData.id" :addDialogVisible="tjwkpzVisible"
      @onClose="tjwkpzVisible = false" :jsdData="jsdData" :signing_company_data="signing_company_data"
      @onSuccess="onSuccess"></tjwkpzCom>
    <!-- 审核尾款信息 -->
    <shwkxxCom :wkxxData="wkxxData" :detailData="detailData" :project_id="this.detailData.id"
      :addDialogVisible="shwkxxVisible" @onClose="shwkxxVisible = false" @onSuccess="onSuccess"></shwkxxCom>
    <!-- 确认尾款信息 -->
    <qrwkxxCom :wkxxData="wkxxData" :detailData="detailData" :project_id="this.detailData.id"
      :addDialogVisible="qrwkxxVisible" @onClose="qrwkxxVisible = false" @onSuccess="onSuccess"></qrwkxxCom>
    <!-- 管理员回退项目 -->
    <el-dialog title="选择回退目标" :visible.sync="adminBackShow" width="400px" @close="adminBackShow = false">
      <el-select filterable style="width: 100%" v-model="backValue" placeholder="请选择">
        <el-option v-for="(item, index) in backOptions" :key="index" :label="item.label" :value="item.value">
        </el-option>
      </el-select>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="adminBackSubmit" :loading="addLoading">提交</el-button>
        <el-button @click="adminBackShow = false">关闭</el-button>
      </span>
    </el-dialog>
    <!-- 详情 -->
    <el-drawer title="增减项详情" :visible.sync="drawerVisible" direction="rtl" size="600px" :before-close="drawerClose">
      <idiInfo :change_id="checkedId" v-if="drawerVisible"> </idiInfo>
    </el-drawer>
    <!-- 详情 -->
    <el-drawer title="售后详情" :visible.sync="drawerVisible_" direction="rtl" size="600px" :before-close="drawerClose_">
      <asInfo :after_sales_id="after_sales_id" v-if="drawerVisible_"> </asInfo>
    </el-drawer>
  </div>
</template>

<script>
import * as math from "mathjs";
import projectApi from "@/api/projectApi";
import companyApi from "@/api/companyApi";
import adminApi from "@/api/adminApi";
import { getUserInfo } from "@/utils/auth";
import foremanApi from "@/api/foremanApi";
import addProjectCom from "@/components/addProjectCom/index";
import fpkhjlCom from "@/components/projectPopu/fpkhjlCom/index";
import scsjtCom from "@/components/projectPopu/scsjtCom/index";
import kcxxCom from "@/components/projectPopu/kcxxCom/index";
import kcfdkqrCom from "@/components/projectPopu/kcfdkqrCom/index";
import dkrzCom from "@/components/projectPopu/dkrzCom/index";
import fpgcjCom from "@/components/projectPopu/fpgcjCom/index";
import tjkcxxCom from "@/components/projectPopu/tjkcxxCom/index";
import shkczlCom from "@/components/projectPopu/shkczlCom/index";
import sqbjCom from "@/components/projectPopu/sqbjCom/index";
import fpzjyCom from "@/components/projectPopu/fpzjyCom/index";
import cjzjdCom from "@/components/projectPopu/cjzjdCom/index";
import shbjdCom from "@/components/projectPopu/shbjdCom/index";
import dkbjCom from "@/components/projectPopu/dkbjCom/index";
import shdkbjdCom from "@/components/projectPopu/shdkbjdCom/index";
import tjqdhtCom from "@/components/projectPopu/tjqdhtCom/index";
import tjyfkpzCom from "@/components/projectPopu/tjyfkpzCom/index";
import yfkdkqrCom from "@/components/projectPopu/yfkdkqrCom/index";
import qrkssgCom from "@/components/projectPopu/qrkssgCom/index";
import jdysCom from "@/components/projectPopu/jdysCom/index";
import jdysshCom from "@/components/projectPopu/jdysshCom/index";
import tjjdkpzCom from "@/components/projectPopu/tjjdkpzCom/index";
import jdkqrCom from "@/components/projectPopu/jdkqrCom/index";
import qrzjxCom from "@/components/projectPopu/qrzjxCom/index";
import gcjljjjdCom from "@/components/projectPopu/gcjljjjdCom/index";
import xmqxCom from "@/components/projectPopu/xmqxCom/index";
import sgjlCom from "@/components/projectPopu/sgjlCom/index";
import cjjsdCom from "@/components/projectPopu/cjjsdCom/index";
import projectLogCom from "@/components/projectPopu/projectLogCom/index";
import shjsdCom from "@/components/projectPopu/shjsdCom/index";
import tjwkpzCom from "@/components/projectPopu/tjwkpzCom/index";
import qrwkxxCom from "@/components/projectPopu/qrwkxxCom/index";
import style from "tinymce-imageupload/css/style";
import idiInfo from "@/components/increaseDecreaseItemsInfo";
import asInfo from "@/components/afterSales";
import shwkxxCom from "@/components/projectPopu/shwkxxCom/index";
export default {
  name: "",
  components: {
    asInfo,
    idiInfo,
    addProjectCom,
    fpkhjlCom,
    scsjtCom,
    kcxxCom,
    kcfdkqrCom,
    dkrzCom,
    fpgcjCom,
    tjkcxxCom,
    shkczlCom,
    sqbjCom,
    fpzjyCom,
    cjzjdCom,
    shbjdCom,
    dkbjCom,
    shdkbjdCom,
    tjqdhtCom,
    tjyfkpzCom,
    yfkdkqrCom,
    qrkssgCom,
    jdysCom,
    jdysshCom,
    tjjdkpzCom,
    jdkqrCom,
    qrzjxCom,
    gcjljjjdCom,
    xmqxCom,
    sgjlCom,
    cjjsdCom,
    projectLogCom,
    shjsdCom,
    tjwkpzCom,
    qrwkxxCom,
    shwkxxCom,
  },
  data() {
    return {
      after_sales_id: "",
      drawerVisible_: false, //售后详情
      checkedId: "",
      drawerVisible: false, //增减项详情
      pageLoading: false,
      addLoading: false,
      backValue: "",
      backOptions: [],
      backOptions2: [
        {
          label: "客户经理选择是否勘场",
          value: 1010,
        },
        {
          label: "客户经理或客户提交设计图",
          value: 1015,
        },
        {
          label: "客户经理申请报价",
          value: 1065,
        },
        {
          label: "造价主管分配造价员,工程部经理分配工程经理",
          value: 1070,
        },
        {
          label: "造价员报价",
          value: 1080,
        },
        {
          label: "工程经理审核造价单",
          value: 1090,
        },
        {
          label: "造价主管审核造价单",
          value: 1092,
        },
        {
          label: "客户经理对客报价",
          value: 1095,
        },
        {
          label: "客户总监审核对客报价",
          value: 1100,
        },
        {
          label: "客户经理签约合同",
          value: 1102,
        },
        {
          label: "客户经理提交预付款信息",
          value: 1105,
        },
        {
          label: "财务确认预付款信息",
          value: 1110,
        },
        {
          label: "工程监理启动工程",
          value: 1115,
        },
        {
          label: "客户经理确认增减项",
          value: 1125,
        },
        {
          label: "造价员出具结算单",
          value: 1130,
        },
        {
          label: "工程经理审核结算单",
          value: 1135,
        },
        {
          label: "造价主管审核结算单",
          value: 1138,
        },
        {
          label: "客户经理提交尾款信息",
          value: 1140,
        },
      ],
      backOptions1: [
        {
          label: "客户经理选择是否勘场",
          value: 1010,
        },
        {
          label: "客户经理或客户提交设计图",
          value: 1015,
        },
        //  需要勘场-------------
        {
          label: "客户经理提交勘场费用",
          value: 1020,
        },
        {
          label: "财务确认勘场费用信息",
          value: 1025,
        },
        {
          label: "工程部经理分配工程经理",
          value: 1030,
        },
        {
          label: "工程经理提交勘场报告",
          value: 1045,
        },
        {
          label: "设计师上传勘场资料",
          value: 1055,
        },
        {
          label: "客户经理或客户提交设计图",
          value: 1060,
        },
        // 需要勘场------------
        {
          label: "客户经理申请报价",
          value: 1065,
        },
        {
          label: "造价主管分配造价员,工程部经理分配工程经理",
          value: 1070,
        },
        {
          label: "造价员报价",
          value: 1080,
        },
        {
          label: "工程经理审核造价单",
          value: 1090,
        },
        {
          label: "造价主管审核造价单",
          value: 1092,
        },
        {
          label: "客户经理对客报价",
          value: 1095,
        },
        {
          label: "客户总监审核对客报价",
          value: 1100,
        },
        {
          label: "客户经理签约合同",
          value: 1102,
        },
        {
          label: "客户经理提交预付款信息",
          value: 1105,
        },
        {
          label: "财务确认预付款信息",
          value: 1110,
        },
        {
          label: "工程监理启动工程",
          value: 1115,
        },
        {
          label: "客户经理确认增减项",
          value: 1125,
        },
        {
          label: "造价员出具结算单",
          value: 1130,
        },
        {
          label: "工程经理审核结算单",
          value: 1135,
        },
        {
          label: "造价主管审核结算单",
          value: 1138,
        },
        {
          label: "客户经理提交尾款信息",
          value: 1140,
        },
      ],
      adminBackShow: false,
      tabLoading: false, //tab点击loading
      zjTableData: [],
      headerCellStyle: {
        backgroundColor: "#F5F8FE",
        color: "#A6AAB8",
      },
      detailData: {},
      hisDrawer: false,
      tabList: [
        {
          label: "基础信息",
          value: 0,
        },
        {
          label: "客户信息",
          value: 1,
        },
        {
          label: "勘场信息",
          value: 2,
        },
        {
          label: "报价信息",
          value: 3,
        },
        {
          label: "合同信息",
          value: 4,
        },
        {
          label: "施工信息",
          value: 5,
        },
        {
          label: "收款信息",
          value: 6,
        },
        {
          label: "结算信息",
          value: 9,
        },
        {
          label: "维保信息",
          value: 7,
        },
      ],
      tabActive: 0,
      tabData: "",
      // 提交勘场凭证
      kcxxVisible: false,
      // 分配客户经理
      fpkhjlVisible: false,
      // 勘场费打款确认
      kcfdkqrVisible: false,
      //收款账户列表
      companyList: [],
      diaLoading: false,
      // 分配工程经理
      fpgcjVisible: false,
      // 提交勘场报告
      tjkcxxVisible: false,
      // 上传勘场资料
      shkczlVisible: false,
      // 用户信息
      userInfoData: {},
      // 对客日志提交
      dkrzVisible: false,
      // 完善项目d
      addFormInline: {
        designer_name: "",
        project_id: "",
        channel_manager_id: "",
        channel_manager_name: "",
        project_type: "",
        project_name: "",
        project_city: [],
        address: "",
        user_id: "",
        channel_manager_id: "",
        brand_id: "",
        survey_site: "",
        designer_id: "",
        template_id: "",
        // engineeringSupervision_id: '',
        survey_date: "",
      },
      addDialogVisible: false,
      surveySiteDisabled: false, //是否能够修改勘场信息
      // 上传设计图
      scsjtVisible: false,
      // 申请报价
      sqbjVisible: false,
      // 分配造价员
      fpzjyVisible: false,
      // 工程经理拒绝接单
      gcjljjjdVisible: false,
      // 出具造价单
      cjzjdVisible: false,
      // 审核造价单
      shbjdVisible: false,
      // 对客报价
      dkbjVisible: false,
      // 取消项目
      xmqxVisible: false,
      // 审核对客报价单
      shdkbjdVisible: false,
      // 签订合同
      tjqdhtVisible: false,
      // 提交预付款凭证
      tjyfkpzVisible: false,
      // 预付款确认
      yfkdkqrVisible: false,
      // 开始施工确认
      qrkssgVisible: false,
      // 节点验收
      projectNodesItem: "", //当前需要验收的节点
      jdysVisible: false,
      jdysRules: {},
      jdysRuleForm: {},
      jdysFormList: [],
      // 节点验收审核
      jdysshVisible: false,
      // 提交进度款凭证
      tjjdkpzVisible: false,
      // 进度款凭证确认
      jdkqrVisible: false,
      // 施工日志
      sgjlVisible: false,
      // 确认增减项
      qrzjxVisible: false,
      // 出具结算单
      cjjsdVisible: false,
      // 审核结算单
      shjsdVisible: false,
      // 提交尾款凭证
      tjwkpzVisible: false,
      // 审核尾款信息
      shwkxxVisible: false,
      // 确认尾款信息
      qrwkxxVisible: false,
      logList: [], //项目日志列表
      activeName: "0", //日志类型
      logLoaidng: false, //日志加载
      hisQuotationData: "", //最近一条历史造价单（再次造价时用）
      startEndDate: "", //申请报价的开工，完工日志（造价员造价用）
      dkData: "", //最新对客报价数据
      zjData: "", //最新一条造价数据
      shkxpzData: "", //财务确认勘场费用凭证数据
      constructionLogs: [],
      signing_company_data: "", //合同数据
      yfkpzData: "", //预付款凭证信息
      jdysArrData: "", //提交节点数据
      jdkpzData: "", //最新一条进度款数据
      jsdData: "", //最新一条结算单数据
      wkxxData: "", //最新一条尾款信息
      jcxxImteShow: true,
      khxxItemShow: true,
      khlxrItemShow: true,
      kcxxItemShow: true,
      xmsjtItemShow: true,
      bjxxItemShow: true,
      zjxxxItemShow: true,
      htxxItemShow: true,
      sgxxItemShow: true,
      sgrzImteShow: true,
      skxxImteShow: true,
      jsxxImteShow: true,
      wbxxImteShow: true,
      wbjlImteShow: true,
    };
  },
  watch: {},
  computed: {},
  mounted() {
    this.userInfoData = getUserInfo();
    this.getProjectDetails();
    console.log(getUserInfo(), "用户信息");
  },
  methods: {
    // 施工日志列表
    getConstructionLogs() {
      projectApi
        .getConstructionLogs({
          project_id: this.$route.query.id || this.detailData.id,
          page: 1,
          num: 99999,
        })
        .then((res) => {
          console.log(res, "施工日志");
          if (res.code == 200) {
            this.constructionLogs = res.data.list;
          }
        });
    },
    // 详情
    getProjectDetails() {
      let backOptions2 = JSON.parse(JSON.stringify(this.backOptions2));
      let backOptions1 = JSON.parse(JSON.stringify(this.backOptions1));
      let backOptions = [];
      let tabList = this.tabList;
      this.pageLoading = true;
      return new Promise((resolve, reject) => {
        projectApi
          .getProjectDetails({
            project_id: this.$route.query.id || this.detailData.id,
          })
          .then((res) => {
            this.pageLoading = false;
            console.log(res, "项目详情", res.data.status, res.data.id);
            if (res.code == 200) {
              res.data.designer_id = res.data.designer_id || "";
              this.detailData = res.data;
              if (res.data.survey_site == 2) {
                backOptions = backOptions1;
              } else {
                backOptions = backOptions2;
              }
              let delVlaue = [];
              backOptions.forEach((item, index) => {
                if (
                  item.value > res.data.status ||
                  item.value == res.data.status
                ) {
                  delVlaue.push(item);
                }
              });
              delVlaue.forEach((item) => {
                let index = backOptions.findIndex((child) => {
                  return item.value == child.value;
                });
                backOptions.splice(index, 1);
              });
              // 判断是否只为勘场工程经理（只能看勘场信息）
              let userInfoData = this.userInfoData;
              let isSiteSurveyors = false;
              if (
                userInfoData.userid == res.data.site_surveyors_id &&
                userInfoData.userid != res.data.engineering_manager_id
              ) {
                isSiteSurveyors = true;
              }
              // 根据项目状态判断tab当前可点击
              tabList.forEach((item) => {
                if (
                  item.label == "勘场信息" &&
                  (res.data.status == 1015 || res.data.status < 1015)
                ) {
                  item.disabled = true;
                }
                if (
                  item.label == "报价信息" &&
                  (res.data.status < 1090 || isSiteSurveyors)
                ) {
                  item.disabled = true;
                }
                if (
                  item.label == "合同信息" &&
                  (res.data.status < 1105 || isSiteSurveyors)
                ) {
                  item.disabled = true;
                }
                if (
                  item.label == "施工信息" &&
                  (res.data.status < 1118 || isSiteSurveyors)
                ) {
                  item.disabled = true;
                }
                // 不勘场（客户经理提交预付款信息）
                if (
                  item.label == "收款信息" &&
                  res.data.survey_site == 1 &&
                  (res.data.status < 1110 || isSiteSurveyors)
                ) {
                  item.disabled = true;
                }
                // 勘场（客户经理提交勘察费用信息）
                if (
                  item.label == "收款信息" &&
                  res.data.survey_site == 2 &&
                  (res.data.status < 1025 || isSiteSurveyors)
                ) {
                  item.disabled = true;
                }
                // 未选择勘场
                if (item.label == "收款信息" && res.data.survey_site == 0) {
                  item.disabled = true;
                }
                if (
                  item.label == "结算信息" &&
                  (res.data.status < 1140 || isSiteSurveyors)
                ) {
                  item.disabled = true;
                }
                if (
                  item.label == "维保信息" &&
                  (res.data.status < 1150 || isSiteSurveyors)
                ) {
                  item.disabled = true;
                }
              });
              this.tabList = tabList;
              // 判断当前需要验收的节点
              let project_nodes = "";
              if (res.data.status == "1120" || res.data.status == "1118") {
                for (let i = 0; i < res.data.project_nodes.length; i++) {
                  if (res.data.project_nodes[i].node_status != 6) {
                    project_nodes = res.data.project_nodes[i];
                    break;
                  }
                }
                this.projectNodesItem = project_nodes;
                console.log(
                  project_nodes,
                  "当前需执行节点",
                  project_nodes.node_status
                );
              }
              // 判断是否有可回退节点
              if (res.data.status == 1120 || res.data.status > 1120) {
                let index = backOptions.findIndex((item) => {
                  return item.value == 1115;
                });
                index = index + 1;
                res.data.project_nodes.forEach((item) => {
                  if (item.node_status > 1) {
                    backOptions.splice(index, 0, {
                      label: item.node_name,
                      value: "node" + index,
                      value1: 1120,
                      node_id: item.id,
                    });
                    index = index + 1;
                  }
                });
              }
              this.backOptions = backOptions;
              console.log(backOptions, "-------------回退列表----------");
              this.getProjectLog();
              resolve();
            } else {
              this.$message.warning(res.message);
            }
          })
          .catch((err) => {
            this.pageLoading = false;
            this.$message.warning(err.message);
          });
      });
    },
    // 项目历史记录
    projectHisFunc() {
      this.hisDrawer = true;
      // this.activeName = "0";
      // this.getProjectLog();
    },
    // tab切换
    tabClickFunc(value, disabled) {
      if (this.tabLoading) return;
      if (disabled) return;
      this.tabLoading = true;
      this.tabActive = -1;
      this.tabData = [];

      if (value == 0) {
        this.getProjectDetails().then((res) => {
          this.tabLoading = false;
          setTimeout(() => {
            this.tabActive = value;
          }, 300);
        });
      } else {
        this.getProjectTabData(value).then((res) => {
          this.tabLoading = false;
          if (value == 3) {
            // 增减项
            this.getProjectTabData(8);
          }
          if (value == 5) {
            // 施工日志
            this.getConstructionLogs();
          }
          setTimeout(() => {
            this.tabActive = value;
          }, 300);
        });
      }
      if (!this.logList.length) {
        this.getProjectLog();
      }
    },
    // 获取tab模块数据
    getProjectTabData(index) {
      return new Promise((resolve, reject) => {
        projectApi
          .getProjectTabData({
            project_id: this.$route.query.id,
            tab_type: index,
          })
          .then((res) => {
            console.log(res, "tab模块数据");
            resolve();
            if (res.code == 200) {
              // 增减项单独处理
              if (index == 8) {
                this.zjTableData = res.data;
                return;
              }
              this.tabData = res.data || [];
            } else {
              if (index == 8) {
                this.zjTableData = [];
                return;
              }
              this.tabData = "";
            }
          });
      });
    },
    // 项目日志类型切换
    tabClick(type) {
      if (this.logLoaidng) return;
      this.activeName = type;
      this.getProjectLog();
    },
    // 获取项目日志
    getProjectLog() {
      this.logList = [];
      this.logLoaidng = true;
      projectApi
        .getProjectLogList({
          project_id: this.$route.query.id || this.detailData.id,
          log_type: Number(this.activeName),
        })
        .then((res) => {
          console.log(res, "项目日志");
          this.logLoaidng = false;
          if (res.code == 200) {
            res.data.forEach((item) => {
              if (item.form_data) {
                item.form_data = JSON.parse(item.form_data);
              }
              // 拿到最新一条尾款数据（审核用）
              if (item.log_status == 410 && !this.wkxxData) {
                this.wkxxData = item.form_data;
              }
              // 拿最新一条结算单数据（审核用）
              if (item.log_status == 380 && !this.jsdData) {
                this.jsdData = item.form_data;
              }
              // 拿最新一条进度款数据（审核用）
              if (item.log_status == 350 && !this.jdkpzData) {
                this.jdkpzData = item.form_data;
              }
              // 拿最新提交节点（审核用）
              if (item.log_status == 320 && !this.jdysArrData) {
                this.jdysArrData = item.form_data.nodes;
              }
              // 拿项目预付款信息
              if (item.log_status == 290 && !this.yfkpzData) {
                this.yfkpzData = item.form_data;
              }
              // 拿合同的签约账户（后续需要继承）
              if (item.log_status == 280 && !this.signing_company_data) {
                this.signing_company_data = item.form_data;
              }
              // 财务确认勘场费用凭证（获取最新一条勘场凭证财务审核时展示）
              if (item.log_status == 140 && !this.shkxpzData) {
                this.shkxpzData = item.form_data;
              }
              // 拿到最近一条历史造价单（再次造价时用,审核用）
              if (item.log_status == 220 && !this.hisQuotationData) {
                this.hisQuotationData = item.form_data;
              }
              // 拿到申请报价的开工，完工日期。填充给造价员造价
              if (item.log_status == 200 && !this.startEndDate.start_date) {
                this.startEndDate = {
                  start_date: item.form_data.start_date,
                  end_date: item.form_data.end_date,
                };
              }
              // 最新一条对客报价数据
              if (!this.dkData && item.log_status == 250) {
                this.dkData = {
                  old_amount: item.form_data.old_amount,
                  new_amount: item.form_data.new_amount,
                  discount_amount: item.form_data.discount_amount,
                  remark: item.form_data.remark,
                };
              }
              // 拿到最新一条造价数据
              if (!this.zjData && item.log_status == 220) {
                this.zjData = item.form_data;
              }
            });
            this.logList = res.data;
          }
        })
        .catch((err) => {
          this.logLoaidng = false;
        });
    },
    // 完善项目
    editProjectFunc() {
      let detailData = this.detailData;
      this.addFormInline = {
        designer_name: detailData.designer_name,
        project_id: detailData.id,
        project_type: detailData.project_type,
        project_name: detailData.project_name,
        project_city: [
          detailData.province_id,
          detailData.city_id,
          detailData.county_id,
        ],
        address: detailData.address,
        user_id: detailData.user_id,
        channel_manager_id: detailData.channel_manager_id,
        brand_id: detailData.brand_id,
        brand_name: detailData.brand_name,
        survey_site: detailData.survey_site,
        designer_id: detailData.designer_id,
        template_id: detailData.template_id,
        template_name: detailData.template_name,
        // engineeringSupervision_id: '',
        survey_date: detailData.survey_date,
        channel_manager_id: detailData.channel_manager_id,
        channel_manager_name: detailData.channel_manager_name,
        receiving_account_id: detailData.receiving_account_id,
      };
      this.surveySiteDisabled = detailData.status >= 1025;
      this.addDialogVisible = true;
    },
    // 关闭完善项目
    cancelFunc() {
      this.addFormInline = {
        designer_name: "",
        project_id: "",
        channel_manager_id: "",
        channel_manager_name: "",
        project_type: "",
        project_name: "",
        project_city: [],
        address: "",
        user_id: "",
        channel_manager_id: "",
        brand_id: "",
        survey_site: "",
        designer_id: "",
        template_id: "",
        // engineeringSupervision_id: '',
        survey_date: "",
      };
      this.$nextTick(() => {
        this.addDialogVisible = false;
      });
    },
    addProjectSuccess() {
      this.getProjectDetails();
      this.$nextTick(() => {
        this.cancelFunc();
      });
    },
    // 节点验收
    jdysShouwFunc() {
      let projectNodesItem = this.projectNodesItem;
      let children = projectNodesItem.children;
      console.log(projectNodesItem.children, "节点", projectNodesItem);
      let jdysRuleForm = {};
      let jdysFormList = [];
      let jdysRules = {};

      children.forEach((item) => {
        let formName = "";
        let obj = {
          name: item.node_name,
          is_required: item.is_required,
          content_type: item.content_type,
        };
        if (item.content_type == 1) {
          // 文本
          formName = `content_${item.id}`;
          jdysRuleForm[formName] = "";
        } else {
          // 图片视频
          formName = `file_${item.id}`;
          jdysRuleForm[formName] = [];
        }
        obj.prop = formName;
        if (item.is_required == 1) {
          if (item.content_type == 1) {
            // 文本
            jdysRules[formName] = [
              { required: true, message: "请输入内容", trigger: "change" },
            ];
          } else {
            // 文件
            jdysRules[formName] = {
              required: true,
              validator: this.ysjdFile,
              trigger: "change",
            };
          }
        }
        jdysFormList.push(obj);
      });
      jdysRuleForm.remark = "";
      this.jdysFormList = jdysFormList; //formitem
      this.jdysRuleForm = jdysRuleForm; //填写数据
      this.jdysRules = jdysRules; //验证是否必填
      this.$nextTick(() => {
        this.jdysVisible = true;
      });
    },
    ysjdFile(rule, value, callback) {
      if (!value.length) {
        callback(new Error("请上传文件"));
      } else {
        callback();
      }
    },
    // 统一弹窗请求完成回调
    onSuccess() {
      this.getProjectDetails();
      this.fpkhjlVisible = false; //分配客户经理
      this.scsjtVisible = false; //上传设计图
      this.kcxxVisible = false; //提交勘场凭证
      this.kcfdkqrVisible = false; //勘场费打款确认
      this.dkrzVisible = false; //对客日志
      this.fpgcjVisible = false; //分配工程经理
      this.gcjljjjdVisible = false; //工程经理拒绝接单
      this.tjkcxxVisible = false; //提交勘场报告
      this.shkczlVisible = false; //上传勘场资料
      this.sqbjVisible = false; //申请报价
      this.fpzjyVisible = false; //分配造价员
      this.cjzjdVisible = false; //出具造价单
      this.shbjdVisible = false; //审核造价单
      this.dkbjVisible = false; //对客报价
      this.shdkbjdVisible = false; //审核对客报价单
      this.tjqdhtVisible = false; //提交签订合同
      this.tjyfkpzVisible = false; //提交预付款凭证
      this.yfkdkqrVisible = false; //预付款凭证确认
      this.qrkssgVisible = false; //确认开始施工
      this.jdysVisible = false; //节点验收
      this.jdysshVisible = false; //节点验收审核
      this.tjjdkpzVisible = false; //提交进度款凭证
      this.jdkqrVisible = false; //进度款打款确认
      this.qrzjxVisible = false; //确认增减项
      this.xmqxVisible = false; //项目取消
      this.sgjlVisible = false; //提交施工日志
      this.cjjsdVisible = false; //出具结算单
      this.shjsdVisible = false; //审核结算单
      this.tjwkpzVisible = false; //提交尾款凭证
      this.shwkxxVisible = false; //审核尾款信息
      this.qrwkxxVisible = false; //确认尾款
    },
    // 判断tab是否显示
    tabIsShowFunc(field_permissions) {
      if (!field_permissions) {
        this.getProjectDetails();
        return;
      }
      let tabList = this.tabList;
      console.log(
        field_permissions,
        "----------------------------------------"
      );
      field_permissions.forEach((item) => {
        switch (item.name) {
          case "基础信息":
            this.jcxxImteShow = item.state != 3;
            break;
          case "客户信息":
            this.khxxItemShow = item.state != 3;
            break;
          case "客户联系人":
            this.khlxrItemShow = item.state != 3;
            break;
          case "勘场信息":
            this.kcxxItemShow = item.state != 3;
            break;
          case "项目设计图":
            this.xmsjtItemShow = item.state != 3;
            break;
          case "报价信息":
            this.bjxxItemShow = item.state != 3;
            break;
          case "增减项信息":
            this.zjxxxItemShow = item.state != 3;
            break;
          case "合同信息":
            this.htxxItemShow = item.state != 3;
            break;
          case "施工信息":
            this.sgxxItemShow = item.state != 3;
            break;
          case "施工日志":
            this.sgrzImteShow = item.state != 3;
            break;
          case "收款信息":
            this.skxxImteShow = item.state != 3;
            break;
          case "结算信息":
            this.jsxxImteShow = item.state != 3;
            break;
          case "维保信息":
            this.wbxxImteShow = item.state != 3;
            break;
          case "维保记录":
            this.wbjlImteShow = item.state != 3;
            break;
          default:
        }
      });
      tabList.forEach((item, index) => {
        switch (item.label) {
          case "基础信息":
            item.hide = !this.jcxxImteShow;
            break;
          case "客户信息":
            item.hide = !this.khxxItemShow && !this.khlxrItemShow;
            break;
          case "勘场信息":
            item.hide = !this.kcxxItemShow && !this.xmsjtItemShow;
            break;
          case "报价信息":
            item.hide = !this.bjxxItemShow && !this.zjxxxItemShow;
            break;
          case "合同信息":
            item.hide = !this.htxxItemShow;
            break;
          case "施工信息":
            item.hide = !this.sgxxItemShow && !this.sgrzImteShow;
            break;
          case "收款信息":
            item.hide = !this.skxxImteShow;
            break;
          case "结算信息":
            item.hide = !this.jsxxImteShow;
            break;
          case "维保信息":
            item.hide = !this.wbxxImteShow && !this.wbjlImteShow;
            break;
          default:
        }
      });
      this.tabList = tabList;
      let tabActive = 0;
      for (let i = 0; i < tabList.length; i++) {
        if (!tabList[i].hide) {
          tabActive = tabList[i].value;
          break;
        }
      }
      // this.tabActive = tabActive;
      this.$nextTick(() => {
        if (tabActive == 0) {
          // this.getProjectDetails();
        } else {
          this.tabClickFunc(tabActive);
        }
      });
    },
    // 回退至报价单、结算单
    xmhtFunc(type) {
      this.$prompt("请输入回退理由", "提示", {
        confirmButtonText: "确定回退",
        cancelButtonText: "取消",
        inputPattern: /^.+$/,
        inputErrorMessage: "理由不能为空",
      })
        .then(({ value }) => {
          if (type == "bj") {
            this.quotationReviewRejected({
              remark: value,
              status: 1080,
              project_id: this.detailData.id,
            });
          } else {
            // 1130
            this.settlementStatementRejected({
              remark: value,
              status: 1130,
              project_id: this.detailData.id,
            });
          }
        })
        .catch(() => { });
    },
    // 回退结算单
    settlementStatementRejected(data) {
      projectApi.settlementStatementRejected(data).then((res) => {
        console.log(res, "回退至结算单");
        if (res.code == 200) {
          this.getProjectDetails();
        }
        this.$message({
          type: res.code == 200 ? "success" : "warning",
          message: res.code == 200 ? "处理成功" : res.message,
        });
      });
    },
    // 回退造价单
    quotationReviewRejected(data) {
      projectApi.quotationReviewRejected(data).then((res) => {
        console.log(res, "回退至报价单");
        if (res.code == 200) {
          this.getProjectDetails();
        }
        this.$message({
          type: res.code == 200 ? "success" : "warning",
          message: res.code == 200 ? "处理成功" : res.message,
        });
      });
    },
    // 管理员回退任意步骤
    adminBackFunc() {
      this.backValue = "";
      this.adminBackShow = true;
    },
    adminBackSubmit() {
      if (!this.backValue) {
        this.$message.warning("请选择回退目标");
        return;
      }
      let backOptions = this.backOptions;
      let index = backOptions.findIndex((item) => {
        return item.value == this.backValue;
      });
      console.log(backOptions[index], "当前选中退回");
      let node_id_arr = [];
      for (let i = index; i < backOptions.length; i++) {
        if (backOptions[i].node_id && backOptions[index].node_id) {
          node_id_arr.push(backOptions[i].node_id);
        }
      }
      console.log(node_id_arr, "node_id_arr");
      this.addLoading = true;
      projectApi
        .projectRollback({
          status: backOptions[index].node_id
            ? backOptions[index].value1
            : backOptions[index].value,
          node_id_arr,
          project_id: this.detailData.id,
          remark: "",
        })
        .then((res) => {
          this.addLoading = false;
          console.log(res, "回退");
          if (res.code == 200) {
            this.getProjectDetails();
            this.adminBackShow = false;
          }
          this.$message({
            type: res.code == 200 ? "success" : "warning",
            message: res.code == 200 ? "处理成功" : res.message,
          });
        })
        .catch(() => {
          this.addLoading = false;
        });
    },
    // 详情(增减项)
    handleEdit(data) {
      this.checkedId = data.item.id;
      this.drawerVisible = true;
    },
    drawerClose() {
      this.drawerVisible = false;
    },
    // 详情（售后）
    handleEdit_(data) {
      this.after_sales_id = data.item.id;
      this.drawerVisible_ = true;
    },
    drawerClose_() {
      this.drawerVisible_ = false;
    },
  },
};
</script>

<style lang="scss" scoped>
@import "./index.scss";
</style>